﻿//Original source (c) Andrey Shchekin, http://www.codeproject.com/KB/aspnet/TypedRepeater.aspx

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MvcImproved.Generic
{
    /// <summary>
    ///     The GenericTemplateContainerAttribute is used to specify the indicies of 
    ///     generic type parameters to pass into construction of a generic data container.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public sealed class GenericTemplateContainerAttribute : Attribute
    {
        /// <summary>
        ///     Initialize the generic template container parameters.
        /// </summary>
        /// <param name="containerType">Data Container type</param>
        /// <param name="genericParameters">Generic parameter indicies</param>
		public GenericTemplateContainerAttribute(Type containerType, params int[] genericParameters)
        {
            ContainerType = containerType;
            GenericParameters = genericParameters;
        }

        /// <summary>
        ///     Type of container
        /// </summary>
        public Type ContainerType { get; private set; }

        /// <summary>
        ///     Generic parameter indicies.
        /// </summary>
        public ICollection<int> GenericParameters { get; private set; }
    }
}
